<template>
  <div class="u-p-20">
    <el-card shadow="never">
      <div slot="header">
        <b class="u-f-16">
          <span>系统配置</span>
        </b>
        <div class="u-right u-5mt">
          <el-button
            type="success"
            size="small"
            icon="el-icon-document-checked"
            @click="submitForm('objForm')"
            v-if="hasPerm('sysConfig')"
          >提交保存</el-button>
        </div>
      </div>
      <el-form :model="objForm" :rules="rules" ref="objForm" label-width="100px" class="u-form">
        <el-form-item label="售后时间(天)" prop="agent_login_username">
          <el-input-number
            v-model="objForm.order_time"
            controls-position="right"
            placeholder="订单售后时间"
          ></el-input-number>
        </el-form-item>

        <el-form-item label="腾讯地图key">
          <el-input v-model="objForm.tx_service_key" placeholder="腾讯地图key"></el-input>
        </el-form-item>
       
        <el-form-item label="一元等多少积分">
          <el-input v-model="objForm.pay_integral" placeholder="一元等多少积分"></el-input>
        </el-form-item>
        <el-form-item label="积分规格">
          <el-input type="textarea" v-model="objForm.integral_rule" placeholder="积分规格"></el-input>
        </el-form-item>
        <el-form-item label="用户收益规则">
          <el-input type="textarea" v-model="objForm.user_earnings_rule" placeholder="用户收益规则"></el-input>
        </el-form-item>
        <el-form-item label="群主收益规则">
          <el-input type="textarea" v-model="objForm.agency_earnings_rule" placeholder="群主收益规则"></el-input>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
import commonEdit from "@/mixins/common-edit";
export default {
  mixins: [commonEdit],
  data() {
    return {
      apiName: "sysConfig",
      backRoute: "", //成功跳转地址
      objForm: {
        order_time: "", //订单售后时间
        tx_service_key: "", //腾讯地图key
        base_benefit: 1, //每单基础公益
        pay_integral: "", //消费积分
        integral_rule: "", //积分规则
        user_earnings_rule: "", //用户收益规则
        agency_earnings_rule: "", //群主收益规则
      },
    };
  },
  methods: {},
  created() {
    const self = this;
    self.$api[self.apiName].info(self.objForm.id).then((response) => {
      if (response.code == 1) {
        self.objForm = response.data;
        self.afterGetInfo();
      }
    });
  },
};
</script>
